/**
 * Copyright (c) 2008, Julien PORTALIER
 * http://featherphp.googlecode.com/
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 */

Message = new Class(
{
	Extends: Dialog.Base,
	
	initialize: function(options)
	{
		this.setOptions({
			'className': 'message',
			'id':        'message',
			'duration':  2000,
			'onHide':    this.onHide.bind(this)
		});
		
		this.parent(options);
//		this.fx = new Fx.Tween(this.dialog);
	},
	
	displayMessage: function(message)
	{
		this.setContent('text', message);
		this.display();
	},
	
	display: function()
	{
		// auto-hide after a while
		$clear(this.timer);
		this.timer = this.hide.delay(this.options.duration, this);
		
		// display
//		this.fx.start('opacity', 0.0, 0.8);
		this.parent();
	},
	
	hide: function()
	{
		// display
//		this.fx.start('opacity', 0.0);
		this.parent();
	}
});
